package ${DTO};

<#list table.importPackages as pkg>
    <#if pkg != "java.io.Serializable">
import ${pkg};
    </#if>
</#list>
<#if springdoc>
import io.swagger.v3.oas.annotations.media.Schema;
<#elseif swagger>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
</#if>
<#if entityLombokModel>
import lombok.Data;
    <#if chainModel>
import lombok.experimental.Accessors;
    </#if>
</#if>
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import javax.validation.constraints.*;

/**
* @description ${table.comment!}创建DTO对象
* @author ${author}
* @time ${date}
*/
<#if entityLombokModel>
@Data
    <#if chainModel>
        @Accessors(chain = true)
    </#if>
</#if>
@Builder
@AllArgsConstructor
@NoArgsConstructor
<#if springdoc>
@Schema(name = "${entity}InsertDTO", description = "${table.comment!}创建DTO对象")
<#elseif swagger>
@ApiModel(value = "${entity}创建DTO对象", description = "${table.comment!}创建DTO对象")
</#if>
public class ${entity}InsertDTO {
<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if !field.keyFlag> <#-- 排除主键字段 -->
        <#if field.comment!?length gt 0>
            <#if springdoc>
    @Schema(description = "${field.comment}")
            <#elseif swagger>
    @ApiModelProperty("${field.comment}")
            <#else>
    /**
    * ${field.comment}
    */
            </#if>
        </#if>
        <#if field.propertyType == "String">
    @NotBlank(message = "${field.comment}不能为空")
        <#else>
    @NotNull(message = "${field.comment}不能为空")
        </#if>
    private ${field.propertyType} ${field.propertyName};

    </#if>
</#list>
<#------------  END 字段循环遍历  ---------->
}